//
//  FriendInviteCellView.m
//  Growth
//
//  Created by 洪波 陈 on 5/20/12.
//  Copyright (c) 2012 MEETStudio. All rights reserved.
//

#import "FriendInviteCellView.h"


@implementation FriendInviteCellView

@synthesize imageView;
@synthesize titleLabel;
@synthesize tipsImageView;
@synthesize actionButton;
@synthesize imageAction;

- (void)dealloc
{
    [imageView release];
    //CLog(@"image retain count %d", [imageView retainCount]);
    [titleLabel release];
    [tipsImageView release];
    [actionButton release];
    [imageAction release];
    
    
    CLog(@"cell release");
    
    [super dealloc];
}

+ (FriendInviteCellView *)cellFromNibNamed:(NSString *)nibName {
    NSArray *nibContents = [[NSBundle mainBundle] loadNibNamed:nibName owner:self options:NULL];
    NSEnumerator *nibEnumerator = [nibContents objectEnumerator];
    FriendInviteCellView *customCell = nil;
    NSObject* nibItem = nil;
    while ((nibItem = [nibEnumerator nextObject]) != nil) {
        if ([nibItem isKindOfClass:[FriendInviteCellView class]]) {
            customCell = (FriendInviteCellView *)nibItem;
            break; // we have a winner
        }
    }
    return customCell;
}


- (id)init
{
    self = [super init];
    if (self) {
        imageView = [[[UIImageView alloc] initWithFrame:CGRectMake(5, 0, 40, 40)] autorelease];
        
        [self addSubview:imageView];
        
        imageView.layer.cornerRadius =3;
        imageView.clipsToBounds = YES;
        
        CLog(@"Cell init");
    }
    
    return self;
}

- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        // Initialization code
        imageView = [[[UIImageView alloc] initWithFrame:CGRectMake(5, 0, 40, 40)] autorelease];
        
        [self addSubview:imageView];
        
        imageView.layer.cornerRadius =3;
        imageView.clipsToBounds = YES;
    
        CLog(@"Cell initWithStyle");
    }
    return self;
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated
{
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

- (void)selected
{
    tipsImageView.hidden = NO;
    actionButton.hidden = YES;
}

@end
